﻿#include <iostream>
#include <cmath>
using namespace std;

class Triangle {
private:
    int a, b, c;
    double S;
    int C;

public:
    Triangle(int sideA, int sideB, int sideC)
        : a(sideA), b(sideB), c(sideC) {}

    bool isValid() const {
        return (a + b > c) && (a + c > b) && (b + c > a);
    }

    void printValidity() const {
        if (isValid()) {
            cout << "The three sides of the input can form a triangle" << endl;
        }
        else {
            cout << "The three sides of the input cannot form a triangle" << endl;
        }
    }

    void judgeType() const {
        if (isValid()) {
            if (a * a + b * b == c * c || b * b + c * c == a * a || a * a + c * c == b * b) {
                cout << "The triangle is a right-angled triangle" << endl;
            }
            else if (a * a + b * b > c * c && a * a + c * c > b * b && b * b + c * c > a * a) {
                cout << "The triangle is an acute triangle" << endl;
            }
            else {
                cout << "The triangle is an obtuse triangle" << endl;
            }
        }
    }

    double area() const {
        if (!isValid()) {
            return -1;
        }
        int p = (a + b + c) / 2;
        return sqrt(p * (p - a) * (p - b) * (p - c));
    }

    int circumference() const {
        if (!isValid()) {
            return -1;
        }
        return a + b + c;
    }
};

int main() {
    int a, b, c;
    cout << "Please enter the three sides of the triangle:" << endl;
    cin >> a >> b >> c;
    Triangle p1(a, b, c);

    p1.printValidity(); // 打印三角形是否有效
    if (p1.isValid()) { // 只有在三角形有效时才打印周长和面积
        cout << "The circumference of the triangle is: " << p1.circumference() << endl;
        cout << "The area of this triangle is: " << p1.area() << endl;
        p1.judgeType(); // 打印三角形的类型
    }

    return 0;
}